package io.github.talelin.latticy;

import java.sql.SQLOutput;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @authoer:wulongbo
 * @createDate:2022/5/9
 * @description:
 */
public class JsonGlobal {

    public static void main(String[] args) {
        String zhengshu="(^-?[1-9](\\d+)?(\\.\\d{1,2})?$)|(^-?0$)|(^-?\\d\\.\\d{1,2}$)";
        Pattern pattern = Pattern.compile(zhengshu);
        Matcher matcher = pattern.matcher("2.55");
        if (!matcher.matches()){
            System.out.println("最多两位小数包含负数");
        }

        String mobile="17343759359";
        String regex = "^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$";
        Pattern p = Pattern.compile(regex);
        Matcher m = p.matcher(mobile);
        System.out.println( m.matches());
    }
}
